package com.lcm.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Coder-Lcm
 * @date: 2020/10/30 20:11
 */
@RestController
@RefreshScope  //开启刷新的能力
public class ConfigClientController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/config/info")
    public String getConfigInfo(){
        return "serverPort: " + serverPort + "\nconfig.info: \t" + configInfo;
    }
}
